package com.kfm.boot;

import com.kfm.boot.bean.Student;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Scope;
import redis.clients.jedis.Jedis;

@SpringBootApplication
@EnableAspectJAutoProxy // 开启AOP
public class BootApplication {

    public static void main(String[] args) {
        ApplicationContext app = SpringApplication.run(BootApplication.class, args);
        Jedis bean = app.getBean(Jedis.class);
        System.out.println(bean);
    }

    @Bean
//    @Lazy
    @Scope("prototype")
    public Student getStudent(){
        return new Student();
    }

}
